<!DOCTYPE html>
<html lang="ch">
<!--开启session-->
<?php session_start(); ?>
<head>
    <meta charset="utf-8">
    <title>多门店管理系统</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/bootstrap-table.min.css">
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/bootstrap-table.min.js"></script>
    <script src="js/bootstrap-table-zh-CN.min.js"></script>

    <!--    js获取日期-->
    <script>
        $(function time() {
            var now = new Date();
            var year = now.getFullYear();
            var month = now.getMonth();
            var date = now.getDate();
            //获取相应ID
            document.getElementById("timer").innerHTML = "时间：" + year + "年" + (month + 1) + "月" + date + "日";
        })
    </script>
    <!--    提交表单-->
    <script>
        function submitData() {
            $.ajax({
                type: "POST",
                url: "3.2ClothsPurchase.php",
                dataType: "json",
                data: {
                    goodid: $("#good_id").val(),
                    number: $("#num_ber").val(),
                    style: $("#sty_le").val(),
                    color: $("#col_or").val(),
                    size: $("#si_ze").val(),
                    price: $("#pri_ce").val(),
                    discount: $("#dis_count").val(),
                },
                success: function (responseText) {
                    if (responseText.status == 'yes') {
                        if (confirm("进货成功，需要继续进货吗？")) {
                            history.go(0);
                        } else {
                            window.location.href = 'main.php';
                        }
                    } else {
                        alert("进货失败，请提交正确的表单");
                        history.go(0);
                    }

                }
            });
        }
    </script>
</head>

<body style="background: #eeeeee">
<div class="jumbotron text-center" style="margin-bottom:0; ">
    <h1>多门店管理系统</h1>
    <div id="timer" style="float: right; font-size: 20px;"></div>
</div>

<nav class="navbar navbar-inverse">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <div class="collapse navbar-collapse" id="myNavbar">
            <ul class="nav navbar-nav">
                <li><a href="main.php" style="font-size: 20px;">我的信息</a></li>
                <li><a href="search.php" style="font-size: 20px;">库存查询</a></li>
                <li><a href="purchase.php" style="font-size: 20px;">进货</a></li>
                <li><a href="sell.php" style="font-size: 20px;">售货</a></li>
                <li><a href="less.php" style="font-size: 20px;">缺货情况</a></li>
                <li><a href="transfer1.php" style="font-size: 20px;">发出的申请</a></li>
                <li><a href="transfer2.php" style="font-size: 20px;">收到的申请</a></li>
                <li><a href="statistic1.php" style="font-size: 20px;">本店销售排名</a></li>
                <li><a href="statistic2.php" style="font-size: 20px;">销售记录</a></li>
            </ul>
        </div>
    </div>
</nav>

<div class="container">
    <div class="row">
        <div class="col-md-8">
            <h4 class="page-head-line">请输入进货信息</h4>
            <div class="alert alert-success">
                这里你必须输入的只有商品编号和数量。
            </div>
            <div class="alert alert-danger">
                如果是库存中没有的商品，请输入完整信息。
            </div>
            <div class="Compose-Message">
                <div class="panel panel-success">
                    <div class="panel-heading">
                        进货单
                    </div>
                    <div class="panel-body">

                        <label>商品编号 : </label>
                        <input type="text" id="good_id" class="form-control"/>
                        <label>进货数量 : </label>
                        <input type="text" id="num_ber" class="form-control"/>
                        <label>款式 : </label>
                        <input type="text" id="sty_le" class="form-control"/>
                        <label>颜色 : </label>
                        <input type="text" id="col_or" class="form-control"/>
                        <label>尺码 : </label>
                        <input type="text" id="si_ze" class="form-control"/>
                        <label>吊牌单价 : </label>
                        <input type="text" id="pri_ce" class="form-control"/>
                        <label>预售折扣 : </label>
                        <input type="text" id="dis_count" class="form-control"/>
                        <hr/>
                        <button class="btn btn-warning" onclick="history.go(0);"> 重置</button>&nbsp;
                        <button class="btn btn-success" onclick="submitData()"> 提交</button>
                    </div>
                    <div class="panel-footer text-muted">
                        <strong>Note : </strong>Please note that we track all messages so don't send any spams.
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div style="float: right;">
                <div id="all">
                    <div class="content" style="text-align: center; border: 1px solid #000000;">
                        <img width="200px" height="200px" src="img/xyq0411.jpg"/>
                        <p>姓名：<?php echo $_SESSION['user']['name']; ?></p>
                        <p>职位：<?php echo $_SESSION['user']['type']; ?></p>
                        <p>所在店：<?php echo $_SESSION['user']['shop_id']; ?></p>
                        <p>用户名：<?php echo $_SESSION['user']['id']; ?></p>
                        <p>
                            <button type="button" onclick="window.location.href='0.2LogOut.php'"
                                    class="btn btn-primary btn-lg ">注销
                            </button>
                        </p>
                    </div>
                </div>
            </div>
            <div style="float: right; margin-top: 20px;">
                <div id="xiaoxun">
                    <div class="content" style="text-align: center; border: 3px solid #B21F2D;">
                        <p style="font-size: 46px; color: #B21F2D;">明德  厚学</p>
                        <p style="font-size: 46px; color: #B21F2D;">求是  创新</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


</body>
</html>